import React, { Component } from 'react'
import '../assets/css/userinfo.scss'
import {fulldateFormat} from '../utils/dateFormat'
import MyDate from './MyDate'
export default class UserInfo extends Component {
  constructor(props){
    super(props)
    console.log(props.birthday);
  }
  render() {
    return (
      <div className='info-box'>
          <h3>{this.props.title}</h3> 
          <div>姓名:{this.props.name}</div>
          <div>年龄:{this.props.age}</div>
          <div>性别:{this.props.gender===1?'男':'女'}</div>
          <div>爱好：{this.props.hobby.join("、")}</div> 
          <div>生日:{fulldateFormat(this.props.birthday,"/")}</div>
          <div>
             <MyDate date={this.props.birthday}></MyDate>
          </div>
      </div>
    )
  }
}
